home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 114 / PC Guia 114.iso / Software / Utils / The Gimp 2.2.1 / gimp-help-2-0.6-setup.exe / {app} / share / gimp / 2.0 / help / en / ch06s07s02.html < prev    next >
Encoding:
Extensible Markup Language  |  2004-12-19  |  11.1 KB  |  281 lines

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.   <head>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6.     <title>7.2.┬áConvolution matrix</title>
  7.     <link rel="stylesheet" href="gimp-help-plain.css" type="text/css" />
  8.     <link rel="stylesheet" href="gimp-help-screen.css" type="text/css" />
  9.     <meta name="generator" content="DocBook XSL Stylesheets V1.66.1" />
  10.     <link rel="start" href="index.html" title="GIMP User Manual" />
  11.     <link rel="up" href="ch06s07.html" title="7.┬áGeneric filters" />
  12.     <link rel="prev" href="ch06s07.html" title="7.┬áGeneric filters" />
  13.     <link rel="next" href="ch06s07s03.html" title="7.3.┬áDilate" />
  14.   </head>
  15.   <body>
  16.     <div xmlns="" class="navheader">
  17.       <table width="100%" summary="Navigation header">
  18.         <tr>
  19.           <th colspan="3" align="center" id="chaptername">7.┬áGeneric filters</th>
  20.         </tr>
  21.         <tr>
  22.           <td width="20%" align="left"><a accesskey="p" href="ch06s07.html">Prev</a>┬á</td>
  23.           <th width="60%" align="center" id="sectionname">7.2.┬áConvolution matrix</th>
  24.           <td width="20%" align="right">┬á<a accesskey="n" href="ch06s07s03.html">Next</a></td>
  25.         </tr>
  26.       </table>
  27.       <hr />
  28.     </div>
  29.     <div class="sect2" lang="en" xml:lang="en">
  30.       <div class="titlepage">
  31.         <div>
  32.           <div>
  33.             <h3 class="title"><a id="plug-in-convmatrix"></a>7.2.┬áConvolution matrix</h3>
  34.           </div>
  35.         </div>
  36.       </div>
  37.       <a id="id3479895" class="indexterm"></a>
  38.       <div class="mediaobject">
  39.         <img src="../images/filters/filters-generic-convolution.png" />
  40.       </div>
  41.       <div class="simplesect" lang="en" xml:lang="en">
  42.         <div class="titlepage">
  43.           <div>
  44.             <div>
  45.               <h4 class="title"><a id="id3479927"></a>Overview</h4>
  46.             </div>
  47.           </div>
  48.         </div>
  49.         <p>
  50.             This filter is found in 
  51.             <span class="guimenuitem">Image>Filters/Generic/<span class="accel">C</span>onvolution Matrix</span>  
  52.           </p>
  53.         <p>
  54.             Here is a mathematician's domain. Most of filters are using convolution 
  55.             matrix. With the Convolution Matrix filter, if the fancy takes you, you 
  56.             can build a custom filter. 
  57.           </p>
  58.         <p>
  59.             What is a convolution matrix? It's possible to get a rough idea of it without using 
  60.             mathematical tools that only a few ones know. Convolution is the treatment of a matrix 
  61.             by another one which is called "kernel". 
  62.           </p>
  63.         <p>
  64.             The Convolution Matrix filter uses a first matrix which is the Image to be treated. 
  65.             The image is a bi-dimensionnal collection of pixels in rectangular coordinates. The 
  66.             used kernel depends on the effect you want.
  67.           </p>
  68.         <p>
  69.             GIMP uses 5x5 or 3x3 matrices. We will consider only 3x3 matrices, they are 
  70.             the most used and they are enough for all effects you want. If all border 
  71.             values of a kernel are set to 
  72.             zero, then system will consider it as a 3x3 matrix.
  73.           </p>
  74.         <p>
  75.             The filter studies successively every pixel of the image. For each of them, 
  76.             which we will calll the "initial pixel", it multiplies value of this 
  77.             pixel and values of the 8 surrounding 
  78.             pixels by the kernel corresponding value. Then it adds the results, and the 
  79.             initial pixel is set to takes this final result value.
  80.           </p>
  81.         <p>
  82.             A simple example:
  83.           </p>
  84.         <div class="mediaobject">
  85.           <img src="../images/filters/examples/convolution-example1.png" />
  86.         </div>
  87.         <p>
  88.             On the left is the image matrix: each pixel is marked with its value. The 
  89.             initial pixel has a red border. The kernel action area has a green border. 
  90.             In the middle is the kernel and, on the right is the convolution result.
  91.           </p>
  92.         <p>
  93.             Here is what happened: the filter read successively, from left to right and 
  94.             from top to bottom, all the pixels of the kernel action area. It multiplied 
  95.             the value of each of them by the kernel corresponding value and added results: 
  96.             (100*0)+(50*1)+(50*0)*(100*0)+(100*0) +(100*0)+(100*0)+(100*0)+(100*0)+(100*0) = 50. 
  97.             The initial pixel took the value 50. Previously, when the initial pixel had 
  98.             value=50, it took the value 100 of the above pixel (the filter doesn't 
  99.             work on the image but on a copy) and so disappeared into the "100" background 
  100.             pixels. As a graphical result, the initial pixel moved a pixel downwards. 
  101.           </p>
  102.       </div>
  103.       <div class="simplesect" lang="en" xml:lang="en">
  104.         <div class="titlepage">
  105.           <div>
  106.             <div>
  107.               <h4 class="title"><a id="id3480045"></a>Options</h4>
  108.             </div>
  109.           </div>
  110.         </div>
  111.         <div class="variablelist">
  112.           <dl>
  113.             <dt>
  114.               <span class="term">Matrix</span>
  115.             </dt>
  116.             <dd>
  117.               <p>
  118.             This is the 5x5 kernel matrix: you enter wanted values directly into boxes.
  119.           </p>
  120.               <p>
  121.             <span class="guilabel">Divisor</span>: The result of previous calculation will be divided by 
  122.             this divisor. You will hardly use 1, that lets result unchanged, and 9 or 25 
  123.             according to matrix size, that gives the average of pixel values.
  124.           </p>
  125.               <p>
  126.             <span class="guilabel">Offset</span>: this value is added to the division result. This is 
  127.             useful if result may be negative. This offset may be negative.
  128.           </p>
  129.             </dd>
  130.             <dt>
  131.               <span class="term">Border</span>
  132.             </dt>
  133.             <dd>
  134.               <p>
  135.             When the initial pixel is on a border, a part of kernel is out of image. You have to 
  136.             decide what filter must do:
  137.           </p>
  138.               <div class="mediaobject">
  139.                 <img src="../images/filters/filters-convolution-milord.png" />
  140.               </div>
  141.               <div class="itemizedlist">
  142.                 <ul type="disc">
  143.                   <li>
  144.                     <p>
  145.                 <span class="guilabel">Extend</span>: this part of kernel is not taken into acount.
  146.               </p>
  147.                     <div class="mediaobject">
  148.                       <img src="../images/filters/filters-convolution-extend.png" />
  149.                     </div>
  150.                   </li>
  151.                   <li>
  152.                     <p>
  153.                 <span class="guilabel">Wrap</span>: this part of kernel will study pixels of the opposite 
  154.                 border, so pixels disappearing from one side reappear on the other side.
  155.               </p>
  156.                     <div class="mediaobject">
  157.                       <img src="../images/filters/filters-convolution-wrap.png" />
  158.                     </div>
  159.                   </li>
  160.                   <li>
  161.                     <p>
  162.                 <span class="guilabel">Crop</span>: Pixels on borders are not modified, but they are cropped.
  163.               </p>
  164.                     <div class="mediaobject">
  165.                       <img src="../images/filters/filters-convolution-crop.png" />
  166.                     </div>
  167.                   </li>
  168.                 </ul>
  169.               </div>
  170.             </dd>
  171.             <dt>
  172.               <span class="term">Channels</span>
  173.             </dt>
  174.             <dd>
  175.               <p>
  176.             You can select there one or several channels the filter will work with.
  177.           </p>
  178.             </dd>
  179.             <dt>
  180.               <span class="term">Automatic</span>
  181.             </dt>
  182.             <dd>
  183.               <p>
  184.             If this option is checked, The Divisor takes the result value of convolution. If 
  185.             this result is equal to zero (it's not possible to divide by zero), then a 128 
  186.             offset is applied. If it is negative ( a negative color is not possible), a 
  187.             255 offset is applied (inverts result).
  188.           </p>
  189.             </dd>
  190.             <dt>
  191.               <span class="term">Alpha weighting</span>
  192.             </dt>
  193.             <dd>
  194.               <p>
  195.             If this option is not checked, the filter doesn't take in account transparency and this 
  196.             may be cause of some artefacts when blurring. 
  197.           </p>
  198.             </dd>
  199.           </dl>
  200.         </div>
  201.       </div>
  202.       <div class="simplesect" lang="en" xml:lang="en">
  203.         <div class="titlepage">
  204.           <div>
  205.             <div>
  206.               <h4 class="title"><a id="id3480234"></a>Examples</h4>
  207.             </div>
  208.           </div>
  209.         </div>
  210.         <p>
  211.       Design of kernels is based on high levels mathematics. You can find ready-made 
  212.       kernels on the Web. Here are a few examples:
  213.     </p>
  214.         <div class="variablelist">
  215.           <dl>
  216.             <dt>
  217.               <span class="term">Sharpen</span>
  218.             </dt>
  219.             <dd>
  220.               <div class="mediaobject">
  221.                 <img src="../images/filters/examples/convolution-sharpen.png" />
  222.               </div>
  223.             </dd>
  224.             <dt>
  225.               <span class="term">Blur</span>
  226.             </dt>
  227.             <dd>
  228.               <div class="mediaobject">
  229.                 <img src="../images/filters/examples/convolution-blur.png" />
  230.               </div>
  231.             </dd>
  232.             <dt>
  233.               <span class="term">Edge enhance</span>
  234.             </dt>
  235.             <dd>
  236.               <div class="mediaobject">
  237.                 <img src="../images/filters/examples/convolution-edge.png" />
  238.               </div>
  239.             </dd>
  240.             <dt>
  241.               <span class="term">Edge detect</span>
  242.             </dt>
  243.             <dd>
  244.               <div class="mediaobject">
  245.                 <img src="../images/filters/examples/convolution-edge-detect1.png" />
  246.               </div>
  247.             </dd>
  248.             <dt>
  249.               <span class="term">Emboss</span>
  250.             </dt>
  251.             <dd>
  252.               <div class="mediaobject">
  253.                 <img src="../images/filters/examples/convolution-emboss.png" />
  254.               </div>
  255.             </dd>
  256.           </dl>
  257.         </div>
  258.       </div>
  259.     </div>
  260.     <div class="navfooter">
  261.       <hr />
  262.       <table width="100%" summary="Navigation footer">
  263.         <tr>
  264.           <td width="40%" align="left"><a accesskey="p" href="ch06s07.html">Prev</a>┬á</td>
  265.           <td width="20%" align="center">
  266.             <a accesskey="u" href="ch06s07.html">Up</a>
  267.           </td>
  268.           <td width="40%" align="right">┬á<a accesskey="n" href="ch06s07s03.html">Next</a></td>
  269.         </tr>
  270.         <tr>
  271.           <td width="40%" align="left" valign="top">7.┬áGeneric filters┬á</td>
  272.           <td width="20%" align="center">
  273.             <a accesskey="h" href="index.html">Home</a>
  274.           </td>
  275.           <td width="40%" align="right" valign="top">┬á7.3.┬áDilate</td>
  276.         </tr>
  277.       </table>
  278.     </div>
  279.   </body>
  280. </html>
  281.